package com.example.serviceImpl;


import com.example.bean.Borrow;
import com.example.mapper.BorrowMapper;
import com.example.service.BorrowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BorrowServiceImpl implements BorrowService {
    @Autowired
    private BorrowMapper borrowMapper;


    @Override
    public List<Borrow> selectBorrowByUserId(int userId){
        return borrowMapper.selectBorrowByUserId(userId);
    }

    @Override
    public List<Borrow> selectBorrowById(String bookId){
        return borrowMapper.selectBorrowById(bookId);
    }

    @Override
    public Borrow selectBorrow(int userId, String bookId) {
        return borrowMapper.selectBorrow(userId,bookId);
    }

    @Override
    public List<Borrow> selectBorrowAll(){
        return borrowMapper.selectBorrowAll();
    }

    @Override
    public int insertBorrow(Borrow borrow){
        return borrowMapper.insertBorrow(borrow);
    }


    @Override
    public int deleteBorrow(int borrowId){
        return borrowMapper.deleteBorrow(borrowId);
    }

    @Override
    public int updateBorrow(Borrow borrow){
        return borrowMapper.updateBorrow(borrow);
    }

}
